/**
 * @file soc.h
 * @author zipeng
 * @brief 根据所测电压,查表法估算电量
 * @version 0.1
 * @date 2022-08-23
 *
 * @copyright Copyright (c) 2022
 *
 */
#ifndef SOC_H
#define SOC_H
#include "stdint.h"

#define MS  0.001f
#define myabs(x)    ((x>0)? (x):(-x))
#define SOC_FUN  \
{ \
    &Soc_Init, \
    &Soc_Predict, \
    &sort_return_index, \
} \

typedef struct
{
    void(*Soc_Init)(void);
    uint8_t(*Soc_Predict)(float in);
    unsigned short (*sort_return_index)(float *a, unsigned short l);
}T_SOC_FUN;
extern T_SOC_FUN Soc_fun;

#endif // SOC_H
